<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../layui/css/layui.css"/>
</head>
<body>
    <table id="demo" lay-filter="test"></table>
    <script src="../layui/layui.js" type="text/javascript" charset="utf-8"></script>
    <script>
        layui.use(['table', 'jquery'], function(){
        var table = layui.table;
        var $ = layui.jquery;
        let obj = null;
        if (parent.search === 0) {
            // 说明是第一个图 查询参数应该是cusLevel
            obj = {cusLevel: parseInt(parent.key), cusCredit:null, cusSatisfaction:null}
        }
        else if(parent.search === 1) {
            // 说明是第二个图 查询参数应该是cusCredit
            obj = {cusLevel: null, cusCredit:parseInt(parent.key), cusSatisfaction:null}
        }
        else {
            // 说明是第三个图 查询参数应该是cusSatisfaction
            obj = {cusLevel: null, cusCredit:null, cusSatisfaction:parent.key}
        }
        table.render({
            elem: '#demo'
            ,height: 312
            ,page: true //开启分页
            ,cols: [[ //表头
            {field: 'cusNo', title: 'ID', sort: true, fixed: 'left'}
            ,{field: 'cusName', title: '用户名'}
            ,{field: 'cusRegionCN', title: '地区'}
            ,{field: 'cusUrl', title: '网站'} 
            ]],
            id:'tableLev'
            ,limit:5
	        ,limits:[5,10,15,20,25,30]
        });
        table.reload('tableLev',{
            url: 'http://localhost:8080/customer/getCustomerByEcharsLev',
            where: obj,
            page: {
                curr:1
            }
        });
  
});
    </script>
</body>
</html>